package com.cam.framework.crud;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CrudMapper<DTO extends CrudDTO, Entity extends CrudEntity> extends BaseMapper<Entity> {

    DTO findById(String id);

    List<DTO> findList(@Param(Constants.WRAPPER) QueryWrapper<DTO> queryWrapper);

    IPage<DTO> findList(@Param(Constants.WRAPPER) QueryWrapper<DTO> queryWrapper, Page<DTO> page);


}
